package com.lh.web.ctrl;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.lh.biz.IProductBiz;
import com.lh.component.data.factory.CategoryFactory;
import com.lh.ctrl.BaseCtrl;

/**
 * @author liuhui
 * @version 1.0
 * @date 2013-5-16 下午10:15:49
 */
@Controller
@RequestMapping("/p")
public class ProductCtrl extends BaseCtrl {
	
	@Resource
	private IProductBiz productBiz;
	@Resource 
	private CategoryFactory categoryFactory;
	
	@RequestMapping("/{id}")
	public String show(@PathVariable Long id,Model model){
		model.addAttribute("out", productBiz.show(id));
		model.addAttribute("categoryMap", categoryFactory.getMap());
		return "/product/show";
	}
	

}
